# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php84-pecl-grpc
_extname=grpc
pkgver=1.67.0
pkgrel=0
pkgdesc="PHP 8.4 extension provide a concrete implementation of the gRPC protocol, layered over HTTP/2."
url="https://pecl.php.net/package/grpc"
arch="all !s390x !ppc64le !riscv64" # build failures
license="Apache-2.0"
_phpv=84
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev openssl-dev linux-headers"
source="
	php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz
	boringssl.patch
	"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=php-config$_phpv
	make
}

check() {
	# Test suite is not a part of pecl release.
	$_php -d extension=modules/$_extname.so --ri $_extname
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/$_php/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/50_$_extname.ini
}

sha512sums="
dca3248bea9d66d1dd0b558bd484dcf8295a1828aac843e94a68b617e64d8b4b954445b5b9c6916cf642a82a94f80fe5801ddc7424a33bad70b7573098ffdcb1  php-pecl-grpc-1.67.0.tgz
6b551439ad5fd513720f1a267dab743b1c261f1662dd7a364080ec5e38a41eaf402e8950c8d8a5c3ef49297be8954f10d1ae9414da3ebce96a2dc8d87bee6bfd  boringssl.patch
"
